#ifndef AUDIOHANDLER_H
#define AUDIOHANDLER_H

#include <QObject>
#include <QAudioInput>
#include <QAudioOutput>
#include <QAudioFormat>
#include <QUdpSocket>

class AudioSender : public QObject {
    Q_OBJECT
public:
    explicit AudioSender(QString ip, int port, QObject *parent = nullptr);
    void start();

private:
    QUdpSocket *socket;
    QAudioInput *audioInput;
    QIODevice *inputDevice;
    QString ip;
    int port;
};

class AudioRecver : public QObject {
    Q_OBJECT
public:
    explicit AudioRecver(QString ip, int port, QObject *parent = nullptr);
    void start();

private:
    QUdpSocket *socket;
    QAudioOutput *audioOutput;
    QIODevice *outputDevice;
    QAudioFormat format;
};

#endif // AUDIOHANDLER_H
//#ifndef AUDIOHANDLER_H
//#define AUDIOHANDLER_H

//#include <QObject>

//class audiohandler : public QObject
//{
//    Q_OBJECT
//public:
//    explicit audiohandler(QObject *parent = nullptr);

//signals:

//};

//#endif // AUDIOHANDLER_H
